<template>
	<view class="page"  :style="{minHeight:windowHeight+'px'}">
		<view v-if="loadding" class="about" v-html="about.article_content"></view>
		<!-- 没有记录 -->
		<view class="d-c-c p30" v-if="about.length == 0">
			<text class="iconfont icon-wushuju"></text>
			<text class="cont">亲，暂无相关记录哦</text>
		</view>
		<!-- <uni-load-more class="not" v-else :loadingType="loadingType"></uni-load-more> -->
	</view>
</template>

<script>
	import uniLoadMore from '@/components/uni-load-more.vue';
	export default {
		components: {
			uniLoadMore
		},
		data() {
			return {
				about: '',
				loadding: false,
				windowHeight: '',
				msgShow: true,
			};
		},
		onLoad() {
			this.getData();
			uni.getSystemInfo({
				success: (res) => {
					this.windowHeight = res.windowHeight;
				}
			});
		},
		onPullDownRefresh() {
			this.getData();
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		computed: {
			/*加载中状态*/
			loadingType() {
				if (this.loadding) {
					return 1;
				} else {
					if (this.about.length != 0) {
						return 2;
					} else {
						return 0;
					}
				}
			}
		},
		methods: {
			/*获取数据*/
			getData() {
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				self._get('plus.article.article/detail', {
						article_id: 10009
					},
					function(res) {
						self.about = res.data.detail; 
						self.loadding = true;
						uni.hideLoading();
					});
			},
			/*跳转页面*/
			gotoPage(path) {
				let self = this;
				if (path.startsWith('/')) {
					uni.navigateTo({
						url: path
					});
				} else {
					self[path]();
				}
			}
		}
	}
</script>

<style lang="scss">
	.about{
		width: 94%;
		margin: 0 auto;
		// padding: 0 20rpx;
		font-size: 32rpx;
	}
</style>
